package com.itheima.Test;

import java.util.Random;

public class Test03 {
    public static void main(String[] args) {
        String str = "abcedefgh";
        char[] chars = str.toCharArray();
        Random rand = new Random();
        for (int i = 0; i < chars.length; i++) {
            int randIndex = rand.nextInt(chars.length);
            char temp = chars[i];
            chars[i] = chars[randIndex];
            chars[randIndex] = temp;
        }
        String result = new String(chars);
        System.out.println(result);


    }
}
